#ifndef __MQTT_H
#define __MQTT_H

#include <string>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <iostream>

#include "mosquitto.h"

enum{
    CONNECT_UNKOWN  = -1,
    CONNECT_SUCCESS = 0,
    CONNECT_FAIL
};

extern char is_connect;

void mosquitto_mqtt_init(struct mosquitto **mosquitto);
void mosquitto_mqtt_connect(struct mosquitto *mosquitto);
void mosquitto_mqtt_connect_callback_set(struct mosquitto *mosquitto);
void mosquitto_mqtt_message_callback_set(struct mosquitto *mosquitto);
void mosquitto_mqtt_disconnect_callback_set(struct mosquitto *mosquitto);
int  mosquitto_mqtt_publish(struct mosquitto *mosquitto, std::string &topic, std::string &message, int qos);

#endif
